import Vue from 'vue'
import Router from 'vue-router'
import Index from '../view/index'
// import UserList from '../view/user/UserList'
import UserListSingle from '../view/user/UserListSingle'
import UserAdd from "../view/user/UserAdd";
import UserEdit from "../view/user/UserEdit";
import AssetList from "../view/asset/AssetList";
import AssetAdd from "../view/asset/AssetAdd";
import AssetEdit from "../view/asset/AssetEdit";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {
          path: 'user',
          name: 'userlist',
          component: UserListSingle,
          children: [
            {
              path: 'add',
              name: 'useradd',
              component: UserAdd,
            },
            {
              path: 'edit/:id',
              name: 'useredit',
              component: UserEdit,
            }
          ]
        },
        {
          path: 'assets',
          name: 'assetlist',
          component: AssetList,
          children: [
            {
              path: 'add',
              name: 'assetadd',
              component: AssetAdd,
            },
            {
              path: 'edit/:id',
              name: 'assetedit',
              component: AssetEdit,
            }
          ]
        },
      ]
    }
  ]
})
